using UnityEngine;
using System.Collections;

public class Zombie : BotBase {

    protected override BotSensor[] CreateSensors()
    {
        BotSensor[] sensors = new BotSensor[4];

        BotWatchEnemySensor botWatchEnemy = new BotWatchEnemySensor(this);
        botWatchEnemy.lookDistance = lookDistance;

        sensors[0] = botWatchEnemy;
        sensors[1] = new BotSoundSensor(this);
        sensors[2] = new BotSmellSensor(this);
        sensors[3] = new BotLightSensor(this);

        return sensors;
    }

    protected override BotBaseMotor GetMotor()
    {
        return GetComponent<ZombieMotor>();
    }

    protected override void MoveTo(GameObject obj)
    {
        lookTarget.transform.position = obj.transform.position;
        botMotor.SetStimulus(obj);
        botMotor.SetRun(false);
    }

    protected override void RunTo(GameObject obj)
    {
        lookTarget.transform.position = obj.transform.position;
        botMotor.SetStimulus(obj);
        botMotor.SetRun(true);
    }

    protected override void LoseTarget()
    {

    }

    protected override bool IsNearAt(GameObject obj)
    {
        return (transform.position - obj.transform.position).sqrMagnitude <= atackDistance;
    }

    protected override void AttackThe(GameObject obj)
    {

    }
}
